package com.yingxin.yx.framework.commons.enums;

/**
 * 访问终端的类型
 */
public enum PcOrAppEnums {

    PC("PC", "电脑端"),
    APP("APP", "移动端");

    private String type;

    private String typeName;

    PcOrAppEnums(String type, String typeName) {
        this.type = type;
        this.typeName = typeName;
    }

    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type;
    }

    public String getTypeName() {
        return typeName;
    }

    public void setTypeName(String typeName) {
        this.typeName = typeName;
    }

    public static PcOrAppEnums getEnum(String type) {
        if (type == null) {
            return null;
        }
        for (PcOrAppEnums i : PcOrAppEnums.values()) {
            if (i.getType().equals(type)) {
                return i;
            }
        }
        return null;
    }
}
